<template>
  <div ref="wrapper">
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import Bscroll from "better-scroll";

export default {
  name: "scroll",
  data() {
    return {
      scroll: null,
    };
  },
  mounted() {
    this.scroll = new Bscroll(this.$refs.wrapper, {
      observeDOM: true,
      click: true,
      probeType: 3,
      pullUpLoad: true,
    });
  },
  methods: {
    toTop(x, y, time) {
      this.scroll.scrollTo(x, y, time);
    },
    refresh(){
      this.scroll.refresh();
    }
  },
};
</script>

<style scope>
</style>